#ifndef __KSVGEDITOR_CORE_KFREEHANDSHAPE_H_
#define __KSVGEDITOR_CORE_KFREEHANDSHAPE_H_

#include <QPainter>
#include "kshape.h"

class KFreeHandShape : public KShape
{
public:
    explicit KFreeHandShape(QGraphicsItem* parent = nullptr);
    ~KFreeHandShape() override;

    KShapeType getShapeType() const override;
    void addPoint(const QPointF& pt) override;

    void finalizeItemGeometry() override;
    QDomElement toSvgElement(QDomDocument& doc) const override;
    void loadFromSvgElement(const QDomElement& elem) override;
    void refreshTransformInfoFromRect() override;

    std::unique_ptr<KExportShape> clone() const override;

protected:
    void hoverMoveEvent(QGraphicsSceneHoverEvent* event) override;
    void updateShape() override;
    void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;


private:
    QPainterPath m_path;

};
#endif //__KSVGEDITOR_CORE_KFREEHANDSHAPE_H_